<?php 
class indexAction extends sfAction{
	private $data = null;
	public function execute($request){
		$this->data['pagination']	= array(
					'page'		=> $request->getParameter('page', 1),
					'limit'		=> $request->getParameter('limit', sfConfig::get('app_news_list_limit')),
					'page_show'	=> 5
				);
		$this->data['news_cate']	= NewsCatesTable::getDataById(intval($request->getParameter('cate_id',-1)));
		
		$this->data['banners']		= BannersTable::getDataListFrontend(null);
		$this->data['news']			= NewsTable::getDataListFrontend(array('cate_id'=>$this->data['news_cate']['id']),$this->data['pagination']['page'],$this->data['pagination']['limit']);
		$this->data['news_total']	= NewsTable::getDataListFrontendCount(array('cate_id'=>$this->data['news_cate']['id']));
		
		
		$pag	= new PaginationHelper($this->data['news_total'], $this->data['pagination']['limit'], $this->data['pagination']['page_show'], $this->data['pagination']['page'], 'news_id_'.$this->data['news_cate']['id']);
		$this->data['pagination_pager']	= $pag->getPaginations();
	
		//echo '<pre>';print_r($this->data);echo'</pre>';die;
		
		$this->setVar('data', $this->data);
	}
}